FROM openjdk:8-jre-alpine
#set enviroments
ENV JAVA_TOOL_OPTIONS="-Xms1024m -Xmx1024m -Xmn256m -XX:NewRatio=4 -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -XX:AutoBoxCacheMax=20000 -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -XX:MaxTenuringThreshold=2"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
RUN mkdir /app
WORKDIR /app
COPY target/iot-server.jar /app/
RUN ["chmod", "+x", "/app/iot-server.jar"]
ENTRYPOINT ["java", "-jar","-Duser.timezone=GMT+08", "/app/iot-server.jar"]
CMD [">/tmp/iot-server.log"]
